Recent operating systems (OS) are equipped with a multiprocessing function that executes multiple processes in parallel on one computer. Typical multiprocessing functions allocate information processor resources to certain processes according to time divisions.
Hence, processes having information processor resources allocated by the operating system have right of use of the allocated information processor resources and behave as if possessing one information processor. To allow this process behavior, the operating system saves context information (such as address conversion information included in a page table used by registers, kernel stacks, and translation lookaside buffers (TLB)) unique to the process that will have the right of use of the information processor resources forfeited, to a kernel memory region. Then, the operating system provides a function (herein referred to as “context switch”) to restore the context information of the process that obtains the right of use to hardware resources.
Recently, a central processing unit (CPU) adds registers and extends instruction sets to efficiently operate the added registers as an approach to improve computing capability. As a result, context size information saved by the process is increased which tends to increase costs such as operating system overhead due to context switching.
To address this problem, recent operating systems have adopted an approach (approach based on StateOwner function) of intentionally avoiding saving registers that do not need saving during a context switch and then saving such registers only when saving is needed after the context switch.
Moreover, since modifying a CPU incurs more costs compared to modifying software, there is a system to reduce the costs of context switches by modifying only the software. In this system, a counter that counts the occurrences of context switches is provided so that when the count exceeds a threshold embedded in the kernel, the context switch system is changed. After the counter wraps around and returns to the default value, the context switch system is restored again, and if the threshold is exceeded the context switch system is changed once more.
The StateOwner function seeks to reduce costs due to context switches by delaying the unnecessary saving of registers. If the program process attempts to access the information of processing apparatus resources for which the saving has been delayed, the OS actually executes the saving process. The CPU is a component that can detect a process accessing a resource subjected to delayed saving. The CPU that detects an access by a process generates an exception by interrupting the OS. An OS interrupted by the CPU terminates the process currently being executed and conducts a saving process for the delayed context information.
This type of OS exception processing has a problem in that, in addition to inviting interruption of process executions, the register saving processing is conducted to execute the exception process in the kernel, thus reducing the throughput of programs executed by the CPU. Therefore, processes frequently using resources that are subject to StateOwner functions lead to the problem of reduced performance of the entire system due to frequent exception occurrences.
A high performance computing job executed by a parallel computer is a program with a property of wanting to ensure a long CPU occupancy time within a certain time period even at the expense of sacrificing responsiveness. Therefore, frequent OS exception processing due to CPU exceptions reduces job throughput and causes a reduction in performance as a parallel computer.
A StateOwner function realized by conventional technology prepares a dedicated register that records the StateOwner in the CPU and the operating system administers this StateOwner dedicated register. As a result, a problem arises due to the complexity of the CPU circuit design and increased manufacturing costs.
From the standpoint only of job execution, there is a need to suppress the occurrence of CPU exceptions as described above. As a result, all context information should be saved when context switching occurs. However, programs focusing on responsiveness are also executed at the same time in recent parallel computers. When a system that saves the entire context when a context switch occurs is adopted, there is a problem that the process time needed for the context switches increases and program responsiveness is lost.
A method of changing context switch systems while programs are running causes a problem for incurring overhead with programs that determine the optimal context switch system before executing programs in the same way as jobs, and for incurring excessive loads with systems that monitor thresholds of counters that count the occurrences of context switches, since the changing of context switch systems frequently occurs while programs are running.
The present invention provides a program that executes a context switch system according to program types.
The following documents are prior art related to an information processing apparatus, and a method and program for controlling the information processing apparatus:
Japanese Unexamined Patent Application Publication No. 2005-18610.
Japanese Unexamined Patent Application Publication No. 2-146631.
Daniel P. Bovet, Marco Cesati, “Detailed Linux Kernels, Vers. 3”, O'Reilly-Japan, Feb. 22, 2007, Chapter 3.3.
Fujitsu Limited, “SPARC64™ VIIIfx Extensions” Ver. 15, Apr. 26, 2010, Internet<URL: http://img.jp.fujitsu.com/downloads/jp/jhpc/sparc64viiifx-extensions.pdf>.
Intel, “Intel(R) 64 and IA-32 Architectures Software Developer's Manual Volume 3A; System Programming Guide, Part 1,” May 2011, Internet<URL: http://www.intel.com/Assets/PDF/manual/253668.pdf>.
LXR community, “the Linux Cross Reference”, Dec. 2, 2009, Internet<URL: http://lxr.linux.no/#linux+v2.6.32/include/linux/sched.h#L1249>.